<#include "/macro.include"/>
<#assign className = table.className>   
<#assign classNameLower = className?uncap_first> 
package ${basepackage}.service;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;


import com.gt.xmall.service.BaseService;

import ${basepackage}.model.${className};
import ${basepackage}.repository.${className}Dao;



@Component
@Transactional(readOnly = true)
public class ${className}Service extends BaseService{
	@Autowired
	private ${className}Dao ${classNameLower}Dao;
	
	public List<${className}> get${className}s(){
		return (List<${className}>)${classNameLower}Dao.findAll();
	}
	
	public ${className} get${className}(Long id){
		return ${classNameLower}Dao.findOne(id);
	}
	@Transactional(readOnly = false)
	public ${className} save${className}(${className} ${classNameLower}){
		return ${classNameLower}Dao.save(${classNameLower});
	}
	
	@Transactional(readOnly = false)
	public void delete${className}(Long id){
		 ${classNameLower}Dao.delete(id);
	}
	
}